//
//  main.swift
//  queue
//
//  Created by lhc on 2023/9/6.
//

import Foundation

var l = LinkListQueue<Int>()
print(l)
for i in 1...10 {
    l.enqueue(element: i)
    print(l)
}

for _ in 1...5 {
    let _ = l.dequeue()
    print(l)
}

for _ in 1...5 {
    let _ = l.dequeue()
    print(l)
}

var l2 = LinkListQueue<String>()
print("l2.head = \(l2.peek() ?? "nil")")
l2.enqueue(element: "hello")
l2.enqueue(element: "world")
print("l2.head = \(l2.peek() ?? "nil")")
print("l2.dequeue = \(l2.dequeue() ?? "nil")")
print("l2.dequeue = \(l2.dequeue() ?? "nil")")
print("l2.dequeue = \(l2.dequeue() ?? "nil")")


